home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
L' Effet Pommier 3
/
L'Effet Pommier - Volume 03.iso
/
Programmation
/
Gooey1.3.1
/
C Templates
/
mmModalDialog.c
< prev
next >
Wrap
Text File
|
1994-04-17
|
22KB
|
616 lines
$$Loop ModalDialogs
$$Message MM Modal Dialog, mm:mmD_$Worksheet.name$.c
$$File mm:mmD_$Worksheet.name$.c
/* mmD_$Worksheet.name$ Handle this dialog */
/* $CopyRight$ */
/* File name: mmD_$Worksheet.name$.c
Function: Handle this modal dialog.
This dialog is called when:
History: $Date$ Original by $Author$
*/
#include "mmCommon$Prototype.name$.h" /* Common */
#include "Common$Prototype.name$.h" /* Common */
#include "$Worksheet.name$.h" /* Users specific file */
/* ======================================================= */
/* ======================================================= */
/* Prototypes */
/* Filter routine for modal dialog routine */
static pascal Boolean MyFilter (DialogPtr theDialog ,EventRecord *theEvent,short *itemHit);
/* This is an update routine for non-controls in the dialog */
/* This is executed after the dialog is uncovered by an alert */
static void Refresh_Dialog(void); /* Refresh the dialogs non-controls */
/* ======================================================= */
/* Routine: InitD_$Worksheet.name$ */
/* Purpose: Initialize the modal dialog, globals and call users routine */
void InitD_$Worksheet.name$(void)
{
Rec_$Worksheet.name$.theDialog = nil;
$$Loop Control.type = Button
Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Button */
$$EndLoop
$$Loop Control.type = HotRect
$$if Control.HotSpot
Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* HotSpot */
$$endif
$$EndLoop
$$Loop Control.type = Checkbox
Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Checkbox */
$$if Control.Selected
Rec_$Worksheet.name$.Value_$Control.name$ = 1;
$$endif
$$if Control.Unselected
Rec_$Worksheet.name$.Value_$Control.name$ = 0;
$$endif
$$EndLoop
$$Loop Control.type = Radio
Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Radio */
$$if Control.Selected
Rec_$Worksheet.name$.Value_$Control.name$ = 1;
$$endif
$$if Control.Unselected
Rec_$Worksheet.name$.Value_$Control.name$ = 0;
$$endif
$$EndLoop
$$Loop Control.type = ScrollBar
Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* ScrollBar */
Rec_$Worksheet.name$.Value_$Control.name$ = $Control.ValueScroll$;
$$EndLoop
$$Loop Control.type = Icon
Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Icon button */
$$EndLoop
$$Loop Control.type = Sicn
Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Sicn button */
$$EndLoop
$$Loop Control.type = Picture
$$if Control.NonGraphic
Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Picture button */
$$endif
$$EndLoop
$$Loop Control.type = UButton
Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Plugin button */
$$EndLoop
$$Loop Control.type = UToggle
Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Plugin toggle */
$$if Control.Selected
Rec_$Worksheet.name$.Value_$Control.name$ = 1;
$$endif
$$if Control.Unselected
Rec_$Worksheet.name$.Value_$Control.name$ = 0;
$$endif
$$EndLoop
$$Loop Control.type = UGauge
Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Plugin gauge */
Rec_$Worksheet.name$.Value_$Control.name$ = $Control.ValueScroll$;
$$EndLoop
$$Loop Control.type = Popup
Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Popup menu */
Rec_$Worksheet.name$.Value_$Control.name$ = $Control.SelectedID$;
$$EndLoop
$$Loop Control.type = Palette
Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Palette */
Rec_$Worksheet.name$.Value_$Control.name$ = $Control.ValueScroll$;
$$EndLoop
$$Loop Control.type = List
Rec_$Worksheet.name$.List_$Control.name$ = nil; /* List */
SetRect(&Rec_$Worksheet.name$.ListRect_$Control.name$,$Control.LeftPosition$,$Control.TopPosition$,$Control.RightPosition$,$Control.BottomPosition$); /* left,top,right,bottom */
$$EndLoop
$$Loop Control.type = EditText
Rec_$Worksheet.name$.TE_$Control.name$ = nil; /* Edit Text */
SetRect(&Rec_$Worksheet.name$.TERect_$Control.name$,$Control.LeftPosition$,$Control.TopPosition$,$Control.RightPosition$,$Control.BottomPosition$); /* left,top,right,bottom */
GetIndString(Rec_$Worksheet.name$.TEStr_$Control.name$,sResD_$Control.name$,1);/* ...Edit text, default value */
$$EndLoop
D_Init_$Worksheet.name$();
}
/* ======================================================= */
/* Routine: MyFilter */
/* Purpose: Filter routine for dialog events */
static pascal Boolean MyFilter (DialogPtr theDialog ,EventRecord *theEvent,short *itemHit)
{
Point MyPt; /* Current list selection point */
Rect tempRect; /* Temporary rectangle */
short DType; /* Type of dialog item */
Handle DItem; /* Handle to the dialog item */
ControlHandle CItem; /* Control handle */
short chCode; /* Key entered */
short code; /* Used for FindControl */
long LTemp; /* Used for time delay */
char MyCmdKey; /* The command key */
Boolean CmdDown; /* Flag for command key used */
Boolean valMyFilter; /* Value to return */
/* Call the user routine */
valMyFilter = D_Filter_$Worksheet.name$(theDialog, theEvent, itemHit);
/* Only do on an update */
if ((theEvent->what == updateEvt) && ((WindowPtr)theEvent->message == theDialog))
{
BeginUpdate(theDialog); /* Start the update */
DrawDialog(theDialog); /* Draw the controls */
valMyFilter = TRUE; /* Pass out this special itemHit number */
*itemHit = 32000; /* Our special ID */
}
if (theEvent->what == mouseDown) /* Only do on a mouse click */
{
MyPt = theEvent->where; /* Get the point where the mouse was clicked */
GlobalToLocal(&MyPt); /* Convert global to local */
$$Loop Control.type = List
if (PtInRect(MyPt,&Rec_$Worksheet.name$.ListRect_$Control.name$))
ClickInTheList(MyPt,theEvent->modifiers,Rec_$Worksheet.name$.List_$Control.name$,$Control.TextSize$,$Control.TextFont$,$Control.TextStyle$,true);
$$EndLoop
$$Loop Control.type = ScrollBar
GetDItem (theDialog ,ResD_$Control.name$, &DType, &DItem, &tempRect);/* Get the item */
if (PtInRect(MyPt,&tempRect))
{
CItem = (ControlHandle)DItem; /* Make it a controlhandle */
code = TestControl(CItem,MyPt); /* Get where in the Scrollbar we were pressed */
HandleWScrollBar(MyPt,code,$Control.StepScroll$,$Control.PageScroll$,CItem);/* Handle the scrollbar */
}
$$EndLoop
$$Loop Control.type = UGauge
GetDItem (theDialog ,ResD_$Control.name$, &DType, &DItem, &tempRect);/* Get the item */
if (PtInRect(MyPt,&tempRect))
{
CItem = (ControlHandle)DItem; /* Make it a controlhandle */
code = TestControl(CItem,MyPt); /* Get where in the gauge we were pressed */
HandleWScrollBar(MyPt,code,$Control.StepScroll$,$Control.PageScroll$,CItem);/* Handle the scrollbar */
}
$$EndLoop
}
CheckKeysInDialog(theDialog,&valMyFilter,theEvent,itemHit);
return(valMyFilter);
}
/* ======================================================= */
/* Routine: Refresh_Dialog */
/* Purpose: Refresh the dialogs non-controls */
static void Refresh_Dialog(void)
{
Rect rTempRect; /* Temp rectangle used for drawing */
short DType; /* Type of dialog item */
Handle DItem; /* Handle to the dialog item */
ControlHandle CItem; /* Control handle */
RGBColor Saved_ForeColor; /* Save colors */
RGBColor Saved_BackColor; /* Save colors */
RGBColor DrawingColor; /* Place to make colors */
SetPort(Rec_$Worksheet.name$.theDialog); /* Point to our dialog window */
rTempRect = tempRect; /* Save the current contents of tempRect */
if (Has.ColorQD) /* See if color QuickDraw is around */
{
GetForeColor(&Saved_ForeColor); /* Save the fore color */
GetBackColor(&Saved_BackColor); /* Save the back color */
RGBForeColor(&Black_ForeColor); /* Set the fore color to Black */
RGBBackColor(&White_BackColor); /* Set the back color to White */
}
$$Loop Control.type = Button
$$if Control.Default
/* This is the default selection, when RETURN is pressed. */
HiliteDefaultButton(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$);
$$endif Control.Default
$$EndLoop Control.type
$$Loop Control.type = Line
/* Draw a line, $Control.FullName$ */
$$if Control.GrayLine
PenPat(&qd.gray); /* Set the gray pen pattern */
$$endif Control.GrayLine
$$if Control.LineWidth ! 1
PenSize($Control.LineWidth$,$Control.LineWidth$);
$$endif Control.LineWidth
MoveTo($Control.LeftPosition$,$Control.TopPosition$); /* Horz,vert, Move to starting position */
LineTo($Control.RightPosition$,$Control.BottomPosition$); /* Horz,vert, Draw to the ending position */
$$if Control.LineWidth ! 1
PenSize(1,1);
$$endif Control.LineWidth
$$if Control.GrayLine
PenPat(&qd.black); /* Back to default pen pattern */
$$endif Control.GrayLine
$$EndLoop
$$Loop Control.type = StaticText
$$if Control.SpecialText
/* Draw static text */
$$if Control.TextColor ! Black
if (Has.ColorQD) /* See if color QuickDraw is around */
{
DrawingColor.red = 0x$Control.RedTextColor$;
DrawingColor.green = 0x$Control.GreenTextColor$;
DrawingColor.blue = 0x$Control.BlueTextColor$;
RGBForeColor(&DrawingColor); /* Set the fore color */
RGBBackColor(&Saved_BackColor); /* Set the back color */
}
$$endif Control.TextColor
$$if Control.MultipleLine
SetRect(&tempRect,$Control.LeftPosition$,$Control.TopPosition$,$Control.RightPosition$,$Control.BottomPosition$);
DrawStaticTextBox(sResD_$Control.name$,&tempRect,$Control.TextAlignment$,$Control.TextSize$,$Control.TextFont$,$Control.TextStyle$);
$$endif Control.MultipleLine
$$if Control.SingleLine
DrawStaticLine(sResD_$Control.name$,$Control.LeftPosition$,$Control.TopPosition$,$Control.TextSize$,$Control.TextFont$,$Control.TextStyle$);
$$endif Control.SingleLine
$$if Control.TextColor ! Black
if (Has.ColorQD) /* See if color QuickDraw is around */
{
RGBForeColor(&Black_ForeColor); /* Set the fore color */
RGBBackColor(&White_BackColor); /* Set the back color */
}
$$endif Control.TextColor
$$endif Control.SpecialText
$$EndLoop
$$Loop Control.type = List
UpdateTheList(Rec_$Worksheet.name$.theDialog->visRgn,Rec_$Worksheet.name$.List_$Control.name$,
&Rec_$Worksheet.name$.ListRect_$Control.name$,$Control.TextSize$,$Control.TextFont$,$Control.TextStyle$,true);
$$EndLoop
TextSize(12);
TextFont(systemFont); /* Select the Font that we want */
TextFace(0); /* Select the style that we want */
if (Has.ColorQD) /* See if color QuickDraw is around */
{
RGBForeColor(&Saved_ForeColor); /* Restore the fore color */
RGBBackColor(&Saved_BackColor); /* Restore the back color */
}
D_Refresh_$Worksheet.name$(Rec_$Worksheet.name$.theDialog); /* Call user refresh routine */
}
/* ======================================================= */
/* Routine: MPD_$Worksheet.name$ */
/* Purpose: Modal dialog */
void MPD_$Worksheet.name$(void)
{
Rect tempRect; /* Temporary rectangle */
short DType; /* Type of dialog item */
short Index; /* For looping */
Handle DItem; /* Handle to the dialog item */
ControlHandle CItem; /* Control handle */
ControlHandle CTempItem; /* Control handle */
Str255 sTemp; /* Get text entered, temp holding */
short itemHit; /* Get selection */
short temp; /* Get selection, temp holding */
short theSelection; /* For Palettes */
long theLong,LTemp2; /* For Hotspot setup */
short theRow; /* This is used to define the row used in a list */
FontInfo ThisFontInfo; /* Used to determine List element height */
TEHandle ThisEditText; /* Handle to get the Dialogs TE record */
GrafPtr SavedPort; /* Previous grafport */
Boolean ExitDialog; /* Flag used to exit the Dialog */
Point MyPt;
#if defined(powerc) || defined(__powerc)
ModalFilterUPP theFilter;
#endif
#if defined(powerc) || defined(__powerc)
theFilter = NewModalFilterProc(MyFilter);
#endif
GetPort(&SavedPort); /* Get the previous grafport */
HoldOffUserEvents = true; /* Hold off the user events */
Rec_$Worksheet.name$.theDialog = GetNewDialog(ResD_$Worksheet.name$,nil,(WindowPtr)-1);/* Bring in the dialog resource */
SetPort(Rec_$Worksheet.name$.theDialog); /* Prepare to add conditional text */
$$if Worksheet.Center
tempRect = Rec_$Worksheet.name$.theDialog->portRect; /* Get the windows position and size */
$$if Worksheet.CenterHorz
tempRect.left = ((screenRect.bounds.right - screenRect.bounds.left) - (tempRect.right - tempRect.left)) / 2; /* Center Horz */
$$endif Worksheet.CenterHorz
$$if Worksheet.CenterVert
tempRect.top = ((screenRect.bounds.bottom - screenRect.bounds.top) - (tempRect.bottom - tempRect.top)) / 3; /* 1/3 vert */
if (tempRect.top < 40) /* Keep below the menu bar */
tempRect.top = 40;
$$endif Worksheet.CenterVert
MoveWindow(Rec_$Worksheet.name$.theDialog,tempRect.left,tempRect.top,true);
$$endif
$$Loop Control.type = Button
/* Button */
SetupNormalControl(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,0);
$$EndLoop Button
$$Loop Control.type = Checkbox
/* Checkbox */
SetupNormalControl(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,
Rec_$Worksheet.name$.Value_$Control.name$);
$$EndLoop Checkbox
$$Loop Control.type = Radio
/* Radio button */
SetupNormalControl(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,
Rec_$Worksheet.name$.Value_$Control.name$);
$$EndLoop Radio
$$Loop Control.type = List
/* Make a List */
Make_A_List(&Rec_$Worksheet.name$.List_$Control.name$,&Rec_$Worksheet.name$.ListRect_$Control.name$,
Rec_$Worksheet.name$.theDialog,sResD_$Control.name$,$Control.TextSize$,$Control.TextFont$,$Control.TextStyle$,true);
$$EndLoop
$$Loop Control.type = HotRect
/* Draw a Hotspot or Rectangle */
SetupHotSpot(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,$Control.MakeHotSpot$,$Control.LineWidth$,
$Control.ShadowWidth$,sResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$);
$$EndLoop
$$Loop Control.type = EditText
GetDItem(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,&DType,&DItem,&tempRect);/* Get the item handle */
GetIndString(sTemp,sResD_$Control.name$,1); /* ...Edit text, default value */
SetIText(DItem,sTemp); /* Set the default text string */
SelIText(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,0,300);
$$EndLoop
$$Loop Control.type = Popup
SetupPopupMenu(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,
mResD_$Control.name$,Rec_$Worksheet.name$.Value_$Control.name$);
$$EndLoop
$$Loop Control.type = Picture
$$if Control.NonGraphic
/* Draw a picture */
LTemp = ResD_N_$Control.name$; /* Picture ID and resize flag */
$$if Control.ClipPicture
LTemp = 0x00010000 | LTemp;
$$endif Control.ClipPicture
SetupTheItem(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,true,true,
Rec_$Worksheet.name$.Enable_$Control.name$,false,&tempRect,LTemp,0);/* Setup the Picture button */
$$endif Control.NonGraphic
$$EndLoop
$$Loop Control.type = Palette
/* Draw a Palette */
SetupPalette(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,
$Control.NumRows$,$Control.NumColumns$,ResD_N_$Control.name$,$Control.HMethod$);
$$EndLoop
$$Loop Control.type = Icon
$$if Control.NonGraphic
/* Draw an Icon button */
SetupIconSicn(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,
ResD_N_$Control.name$,ResD_H_$Control.name$);
$$endif Control.NonGraphic
$$EndLoop
$$Loop Control.type = Sicn
/* Draw an Sicn */
$$if Control.Graphic
SetupIconSicn(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,
ResD_N_$Control.name$,ResD_N_$Control.name$);
$$endif Control.Graphic
$$if Control.NonGraphic
SetupIconSicn(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,
ResD_N_$Control.name$,ResD_H_$Control.name$);
$$endif Control.NonGraphic
$$EndLoop
$$Loop Control.type = UButton
SetupPlugin(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,
ResD_N_$Control.name$,ResD_H_$Control.name$,sResD_$Control.name$);
$$EndLoop
$$Loop Control.type = UToggle
SetupPlugin(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,
ResD_N_$Control.name$,ResD_H_$Control.name$,sResD_$Control.name$);
$$EndLoop
$$Loop Control.type = UGauge
SetupPlugin(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,
ResD_N_$Control.name$,ResD_H_$Control.name$,sResD_$Control.name$);
SetupMinMaxValue(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,$Control.MinScroll$,$Control.MaxScroll$,Rec_$Worksheet.name$.Value_$Control.name$);
$$EndLoop
$$Loop Control.type = ScrollBar
SetupTheItem(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,true,true,
Rec_$Worksheet.name$.Enable_$Control.name$,true,&tempRect,0,0);
SetupMinMaxValue(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,$Control.MinScroll$,$Control.MaxScroll$,Rec_$Worksheet.name$.Value_$Control.name$);
$$EndLoop
ExitDialog = false; /* Do not exit dialog handle loop yet */
$$Link Worksheet.Open
D_Setup_$Worksheet.name$(Rec_$Worksheet.name$.theDialog); /* Call user Dialog setup routine */
ShowWindow(Rec_$Worksheet.name$.theDialog); /* Open a dialog box */
SelectWindow(Rec_$Worksheet.name$.theDialog); /* Lets see it */
do /* Start of dialog handle loop */
{
#if defined(powerc) || defined(__powerc)
ModalDialog(theFilter,&itemHit); /* Wait until an item is hit */
#else
ModalDialog((ModalFilterProcPtr)&MyFilter,&itemHit); /* Wait until an item is hit */
#endif
D_Hit_$Worksheet.name$(Rec_$Worksheet.name$.theDialog,&itemHit,&ExitDialog);/* Let user handle the item hit */
if (itemHit == 32000) /* Check for update */
{
Refresh_Dialog(); /* Draw any Lists, lines, or rectangles */
EndUpdate(Rec_$Worksheet.name$.theDialog); /* End of the update */
}
else
{
GetDItem(Rec_$Worksheet.name$.theDialog, itemHit, &DType, &DItem, &tempRect);/* Get item information */
CItem = (ControlHandle)DItem; /* Get the control handle */
}
/* Handle it real time */
$$Loop Control.type = Button
if (itemHit == ResD_$Control.name$) /* Handle the Button being pressed */
{
$$Link Control.Select
$$if Control.ExitDialog
ExitDialog = true; /* Close this dialog, exit */
$$endif Control.ExitDialog
}
$$EndLoop Control.type
$$Loop Control.type = Checkbox
if (itemHit == ResD_$Control.name$) /* Handle the checkbox being pressed */
{
temp = GetCtlValue(CItem); /* Get the current Checkbox value */
SetCtlValue(CItem, (temp + 1) & 1); /* Toggle the value to the opposite */
Rec_$Worksheet.name$.Value_$Control.name$ = GetCtlValue(CItem); /* Get the current Checkbox value */
$$if Control.HasLinks
if (Rec_$Worksheet.name$.Value_$Control.name$ == 0)
{
$$Link Control.Deselect
}
else
{
$$Link Control.Select
}
$$endif
}
$$EndLoop Control.type
$$Loop Control.type = UButton
$$if Control.HasLinks
if (itemHit == ResD_$Control.name$) /* Handle the Button being pressed */
{
$$Link Control.Select
}
$$endif
$$EndLoop Control.type
$$Loop Control.type = UToggle
if (itemHit == ResD_$Control.name$) /* Handle the checkbox being pressed */
{
temp = GetCtlValue(CItem); /* Get the current Checkbox value */
SetCtlValue(CItem, (temp + 1) & 1); /* Toggle the value to the opposite */
Rec_$Worksheet.name$.Value_$Control.name$ = GetCtlValue(CItem); /* Get the current Checkbox value */
$$if Control.HasLinks
if (Rec_$Worksheet.name$.Value_$Control.name$ == 0)
{
$$Link Control.Deselect
}
else
{
$$Link Control.Select
}
$$endif
}
$$EndLoop Control.type
$$Loop Control.type = Radio
if (itemHit == ResD_$Control.name$) /* Handle the Radio being pressed */
{
SetCtlValue(CItem,1);
Rec_$Worksheet.name$.Value_$Control.name$ = 1; /* Set the current Radio value */
$$Loop RadioGroup
ClearTheRadio(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,&Rec_$Worksheet.name$.Value_$Control.name$);
$$EndLoop RadioGroup
$$Link Control.Select
}
$$EndLoop Control.type
$$Loop Control.type = HotRect
$$if Control.HotSpot
$$if Control.HasLinks
if (itemHit == ResD_$Control.name$) /* Handle the HotSpot being pressed */
{
$$Link Control.Select
}
$$endif
$$endif Control.HotSpot
$$EndLoop
$$Loop Control.type = Popup
$$EndLoop
$$Loop Control.type = Picture
$$if Control.NonGraphic
$$if Control.HasLinks
if (itemHit == ResD_$Control.name$) /* Handle the Picture being pressed */
{
$$Link Control.Select
}
$$endif
$$endif Control.NonGraphic
$$EndLoop
$$Loop Control.type = Palette
$$EndLoop
$$Loop Control.type = Icon
$$if Control.NonGraphic
$$if Control.HasLinks
if (itemHit == ResD_$Control.name$) /* Handle the Icon being pressed */
{
$$Link Control.Select
}
$$endif
$$endif Control.NonGraphic
$$EndLoop
$$Loop Control.type = Sicn
$$if Control.NonGraphic
$$if Control.HasLinks
if (itemHit == ResD_$Control.name$) /* Handle the Sicn being pressed */
{
$$Link Control.Select
}
$$endif
$$endif Control.NonGraphic
$$EndLoop
}
while (!ExitDialog); /* Handle dialog items until exit selected */
/* Get results after dialog */
D_Exit_$Worksheet.name$(Rec_$Worksheet.name$.theDialog); /* Exiting the modal dialog */
$$Link Worksheet.Close
SetPort(SavedPort); /* Restore the previous grafport */
DisposDialog(Rec_$Worksheet.name$.theDialog); /* Flush the dialog out of memory */
HoldOffUserEvents = false; /* Let in the user events */
}
/* ======================================================= */
/* ======================================================= */
$$CloseFile
$$EndLoop